package com.chrray.position.controller.web;

import com.chrray.position.domain.FdUser;
import com.chrray.position.entity.position.FdPostingsUserExeVo;
import com.chrray.position.entity.position.FdUserExe;
import com.chrray.position.pojo.dto.BaseIdDto;
import com.chrray.position.pojo.dto.BasePostingsIdDto;
import com.chrray.position.service.web.WFdUserService;
import com.chrray.position.util.result.PageBean;
import com.chrray.position.util.result.ResponseResult;
import io.swagger.annotations.Api;
import io.swagger.annotations.ApiOperation;
import io.swagger.annotations.ApiResponse;
import io.swagger.annotations.ApiResponses;
import lombok.AllArgsConstructor;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;

import static com.chrray.position.util.result.ResponseResults.PAGE;
import static com.chrray.position.util.result.ResponseResults.success;

/**
 * 业务系统用户控制器
 *
 * @author lm
 * @since 1.0.1 2024-09-02
 */
@RestController
@RequestMapping("/api/web/postingsUser")
@Api(tags = "招聘人员列表")
@AllArgsConstructor
public class WFdPostingUserController {
    @Autowired
    private WFdUserService wFdUserService;



    @GetMapping("/pagePostingsUserList")
    @ApiOperation("列表")
    public ResponseResult<PageBean<FdUserExe>> pagePostingsUserList(FdUserExe fdUser) {
        return PAGE(wFdUserService.pagePostingsUserList(fdUser));
    }


    @GetMapping("/detailById")
    @ApiOperation("查询详情")
    public ResponseResult<FdPostingsUserExeVo> detailById(BasePostingsIdDto dto){
        return  success(wFdUserService.detailById(dto));
    }


    @GetMapping("/employ")
    @ApiOperation("录用")
    public ResponseResult<Object> employ(BasePostingsIdDto dto){
        return  success(wFdUserService.employ(dto));
    }



    @GetMapping("/cancelEmploy")
    @ApiOperation("取消录用")
    public ResponseResult<Object> cancelEmploy(BasePostingsIdDto dto){
        return  wFdUserService.cancelEmploy(dto);
    }
    @GetMapping("/complete")
    @ApiOperation("完工")
    public ResponseResult<Object> complete(BasePostingsIdDto dto){
        return  wFdUserService.complete(dto);
    }

}
